$(document).ready(function()
{
	/*
	 * 测试登录 content = {}; content["adminName"] = "123456"; content["adminPwd"] =
	 * "123456"; $.ajax ({ type : "POST", dataType : "json", contentType :
	 * "application/json", data : JSON.stringify(content), url :
	 * "/randomdelivery/AdminController/admin/login", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
	
	// 测试修改
	/*
	 * content = {}; content["adminId"] = "2"; content["adminName"] = "1234567";
	 * content["adminSex"] = "男"; $.ajax ({ type : "PUT", dataType : "json",
	 * contentType : "application/json", data : JSON.stringify(content), url :
	 * "/randomdelivery/AdminController/Admin", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
	
	// 测试修改
	/*
	 * $.ajax ({ type : "GET", dataType : "json", contentType :
	 * "application/json", url : "/randomdelivery/AdminController/totalUser",
	 * success : function(data) { alert(JSON.stringify(data)); }, error :
	 * function() { alert("error"); } });
	 */
	
	/*
	 * var content = [1,2,3,4]; $.ajax ({ type : "POST", dataType : "json",
	 * contentType : "application/json",
	 * data:JSON.stringify({"adminIds":[1,2,3,4]}), traditional:true, url :
	 * "/randomdelivery/AdminController/closeAccount", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
	/*
	 * var content = {}; content["sequence"] = 2; content["key"] = "1";
	 * alert(JSON.stringify(content)); $.ajax ({ type : "GET", dataType :
	 * "json", contentType : "application/json", traditional:true,
	 * data:JSON.stringify(content), url :
	 * "/randomdelivery/AdminController/users/pageCount/1/pageSize/10", success :
	 * function(data) { alert(JSON.stringify(data)); }, error : function() {
	 * alert("error"); } });
	 */
	
	// 测试删除管理员
	/*
	 * $.ajax ({ type : "DELETE", dataType : "json", contentType :
	 * "application/json", //data : JSON.stringify({"adminId":"1"}), url :
	 * "/randomdelivery/AdminController/Admin/8", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
	
	// 测试重置密码
	/*
	 * $.ajax ({ type : "GET", dataType : "json", contentType :
	 * "application/json", //data : JSON.stringify({"adminId":"1"}), url :
	 * "/randomdelivery/AdminController/resetPassword/2", success :
	 * function(data) { alert(JSON.stringify(data)); }, error : function() {
	 * alert("error"); } });
	 */
	
	var contant = {};
	contant["username"] = "username";
	contant["password"] = "password";
	
	$.ajax
	({
		
		type : "GET",
		dataType : "json",
		contentType : "application/json",
		data : contant,
		url : "./userLoginController/login",
		success : function(data)
		{
			alert(JSON.stringify(data));
		},
		error : function()
		{
			alert("error");
		}
	});
	/*
	 * $.ajax ({ type : "GET", dataType : "json", contentType :
	 * "application/json", data : JSON.stringify({"name":"1"}), url :
	 * "/randomdelivery/AdminController/test", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
	/*
	 * $.ajax ({ type : "GET", dataType : "json", contentType :
	 * "application/json", data : {"pageCount":3,"pageSize":3}, url :
	 * "/randomdelivery/AdminController/test", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
	/*
	 * var content = {} content["userId"] = 2; content["sequence"] = 2;
	 * //content["key"] = ""; $.ajax ({ type : "GET", dataType : "json",
	 * contentType : "application/json", data : content, url :
	 * "AdminController/users/pageCount/2/pageSize/1", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */
/*$.ajax({
        type: "GET",
        url: "/randomdelivery/AdminController/users/pageCount/1/pageSize/10",
        data: JSON.stringify({
            "sequence": 1,
            "key":""
        }),
        data:{"sequence":1},
        async: true,
        dateType: "json",
        contentType: "application/json",
        success: function(data) {alert(JSON.stringify(data));},
        error: function() {
            alert("服务器出错");
        }
    })*/
	
    /*$.ajax({
        type: "POST",
        url: "/randomdelivery/VoucherController/test",
        data: JSON.stringify({
            "vouchersName": "海鲜代金券",
            "vouchersPrice":"15",
            "vouchersDate":10,
            "vouchersFailuretime":new Date().getTime()
        }),
        async: true,
        dateType: "json",
        contentType: "application/json",
        success: function(data) {alert(JSON.stringify(data));},
        error: function() {
            alert("服务器出错");
        }
    })*/
    
	
	
	/*$.ajax({
        type: "GET",
        url: "/randomdelivery/AdminController/differentStateOrderNumber",
        async: true,
        dateType: "json",
        contentType: "application/json",
        success: function(data) {alert(JSON.stringify(data));},
        error: function() {
            alert("服务器出错");
        }
    })*/
	
	
	
	
	$.ajax({
        type: "GET",
        url: "/randomdelivery/CapitalController/capital",
        async: true,
        dateType: "json",
        contentType: "application/json",
        success: function(data) {alert(JSON.stringify(data));},
        error: function() {
            alert("服务器出错");
        }
    })
	
	
	 /*$.ajax({
	        type: "GET",
	        url: "/randomdelivery/AdminController/usersNumberByDay/7",
	        data: JSON.stringify({"voucherIds":[1,2,3,4]
	        }),
	        async: true,
	        dateType: "json",
	        contentType: "application/json",
	        success: function(data) {alert(JSON.stringify(data));},
	        error: function() {
	            alert("服务器出错");
	        }
	    })*/
    /* $.ajax({
        type: "DELETE",
        url: "/randomdelivery/VoucherController/vouchers",
        data: JSON.stringify({"voucherIds":[1,2,3,4]
        }),
        async: true,
        dateType: "json",
        contentType: "application/json",
        success: function(data) {alert(JSON.stringify(data));},
        error: function() {
            alert("服务器出错");
        }
    })*/
    /*$.ajax({
        type: "GET",
        url: "/randomdelivery/AdminController/user/1",
        data: JSON.stringify({
            "sequence": 1,
            "key":""
        }),
        async: true,
        dateType: "json",
        contentType: "application/json",
        success: function(data) {alert(JSON.stringify(data));},
        error: function() {
            alert("服务器出错");
        }
    })*/
	
	
	
	/*
	 * $.ajax ({ type : "POST", dataType : "json", contentType :
	 * "application/json", url : "/randomdelivery/AdminController/test", success :
	 * function(data) { alert(JSON.stringify(data)); }, error : function() {
	 * alert("error"); } });
	 */
	// 测试添加管理员
	/*
	 * var content = {}; content["adminName"] = "654321"; content["adminPwd"] =
	 * "123456"; content["adminSex"] = "男"; $.ajax ({ type : "POST", dataType :
	 * "json", contentType : "application/json", data:JSON.stringify(content),
	 * url : "/randomdelivery/AdminController/Admin", success : function(data) {
	 * alert(JSON.stringify(data)); }, error : function() { alert("error"); }
	 * });
	 */

	/*
	 * $.ajax ({ type : "GET", dataType : "json", contentType :
	 * "application/json", url : "/randomdelivery/AdminController/Admin/8",
	 * success : function(data) { alert(JSON.stringify(data)); }, error :
	 * function() { alert("error"); } });
	 */
	
});


function deleteAdmin(adminId){
	alert(111);
	$.ajax
	({
		type : "DELETE",
		dataType : "json",
		contentType : "application/json",
		data:JSON.stringify({"adminId":adminId}),
		url : "./userLoginController/release",
		success : function(data)
		{
			alert(JSON.stringify(data));
		},
		error : function()
		{
			alert("error");
		}
	});
}